{"ast":null,"code":"import classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport SkeletonAvatar from './Avatar';\nimport SkeletonButton from './Button';\nimport SkeletonNode from './Node';\nimport Element from './Element';\nimport SkeletonImage from './Image';\nimport SkeletonInput from './Input';\nimport Paragraph from './Paragraph';\nimport Title from './Title';\nimport useStyle from './style';\nfunction getComponentProps(prop) {\n  if (prop && typeof prop === 'object') {\n    return prop;\n  }\n  return {};\n}\nfunction getAvatarBasicProps(hasTitle, hasParagraph) {\n  if (hasTitle && !hasParagraph) {\n    // Square avatar\n    return {\n      size: 'large',\n      shape: 'square'\n    };\n  }\n  return {\n    size: 'large',\n    shape: 'circle'\n  };\n}\nfunction getTitleBasicProps(hasAvatar, hasParagraph) {\n  if (!hasAvatar && hasParagraph) {\n    return {\n      width: '38%'\n    };\n  }\n  if (hasAvatar && hasParagraph) {\n    return {\n      width: '50%'\n    };\n  }\n  return {};\n}\nfunction getParagraphBasicProps(hasAvatar, hasTitle) {\n  const basicProps = {};\n  // Width\n  if (!hasAvatar || !hasTitle) {\n    basicProps.width = '61%';\n  }\n  // Rows\n  if (!hasAvatar && hasTitle) {\n    basicProps.rows = 3;\n  } else {\n    basicProps.rows = 2;\n  }\n  return basicProps;\n}\nconst Skeleton = props => {\n  const {\n    prefixCls: customizePrefixCls,\n    loading,\n    className,\n    style,\n    children,\n    avatar = false,\n    title = true,\n    paragraph = true,\n    active,\n    round\n  } = props;\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('skeleton', customizePrefixCls);\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  if (loading || !('loading' in props)) {\n    const hasAvatar = !!avatar;\n    const hasTitle = !!title;\n    const hasParagraph = !!paragraph;\n    // Avatar\n    let avatarNode;\n    if (hasAvatar) {\n      const avatarProps = Object.assign(Object.assign({\n        prefixCls: `${prefixCls}-avatar`\n      }, getAvatarBasicProps(hasTitle, hasParagraph)), getComponentProps(avatar));\n      // We direct use SkeletonElement as avatar in skeleton internal.\n      avatarNode = /*#__PURE__*/React.createElement(\"div\", {\n        className: `${prefixCls}-header`\n      }, /*#__PURE__*/React.createElement(Element, Object.assign({}, avatarProps)));\n    }\n    let contentNode;\n    if (hasTitle || hasParagraph) {\n      // Title\n      let $title;\n      if (hasTitle) {\n        const titleProps = Object.assign(Object.assign({\n          prefixCls: `${prefixCls}-title`\n        }, getTitleBasicProps(hasAvatar, hasParagraph)), getComponentProps(title));\n        $title = /*#__PURE__*/React.createElement(Title, Object.assign({}, titleProps));\n      }\n      // Paragraph\n      let paragraphNode;\n      if (hasParagraph) {\n        const paragraphProps = Object.assign(Object.assign({\n          prefixCls: `${prefixCls}-paragraph`\n        }, getParagraphBasicProps(hasAvatar, hasTitle)), getComponentProps(paragraph));\n        paragraphNode = /*#__PURE__*/React.createElement(Paragraph, Object.assign({}, paragraphProps));\n      }\n      contentNode = /*#__PURE__*/React.createElement(\"div\", {\n        className: `${prefixCls}-content`\n      }, $title, paragraphNode);\n    }\n    const cls = classNames(prefixCls, {\n      [`${prefixCls}-with-avatar`]: hasAvatar,\n      [`${prefixCls}-active`]: active,\n      [`${prefixCls}-rtl`]: direction === 'rtl',\n      [`${prefixCls}-round`]: round\n    }, className, hashId);\n    return wrapSSR( /*#__PURE__*/React.createElement(\"div\", {\n      className: cls,\n      style: style\n    }, avatarNode, contentNode));\n  }\n  return typeof children !== 'undefined' ? children : null;\n};\nSkeleton.Button = SkeletonButton;\nSkeleton.Avatar = SkeletonAvatar;\nSkeleton.Input = SkeletonInput;\nSkeleton.Image = SkeletonImage;\nSkeleton.Node = SkeletonNode;\nexport default Skeleton;","map":{"version":3,"names":["classNames","React","ConfigContext","SkeletonAvatar","SkeletonButton","SkeletonNode","Element","SkeletonImage","SkeletonInput","Paragraph","Title","useStyle","getComponentProps","prop","getAvatarBasicProps","hasTitle","hasParagraph","size","shape","getTitleBasicProps","hasAvatar","width","getParagraphBasicProps","basicProps","rows","Skeleton","props","prefixCls","customizePrefixCls","loading","className","style","children","avatar","title","paragraph","active","round","getPrefixCls","direction","useContext","wrapSSR","hashId","avatarNode","avatarProps","Object","assign","createElement","contentNode","$title","titleProps","paragraphNode","paragraphProps","cls","Button","Avatar","Input","Image","Node"],"sources":["/data/messenger.client/node_modules/antd/es/skeleton/Skeleton.js"],"sourcesContent":["import classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport SkeletonAvatar from './Avatar';\nimport SkeletonButton from './Button';\nimport SkeletonNode from './Node';\nimport Element from './Element';\nimport SkeletonImage from './Image';\nimport SkeletonInput from './Input';\nimport Paragraph from './Paragraph';\nimport Title from './Title';\nimport useStyle from './style';\nfunction getComponentProps(prop) {\n  if (prop && typeof prop === 'object') {\n    return prop;\n  }\n  return {};\n}\nfunction getAvatarBasicProps(hasTitle, hasParagraph) {\n  if (hasTitle && !hasParagraph) {\n    // Square avatar\n    return {\n      size: 'large',\n      shape: 'square'\n    };\n  }\n  return {\n    size: 'large',\n    shape: 'circle'\n  };\n}\nfunction getTitleBasicProps(hasAvatar, hasParagraph) {\n  if (!hasAvatar && hasParagraph) {\n    return {\n      width: '38%'\n    };\n  }\n  if (hasAvatar && hasParagraph) {\n    return {\n      width: '50%'\n    };\n  }\n  return {};\n}\nfunction getParagraphBasicProps(hasAvatar, hasTitle) {\n  const basicProps = {};\n  // Width\n  if (!hasAvatar || !hasTitle) {\n    basicProps.width = '61%';\n  }\n  // Rows\n  if (!hasAvatar && hasTitle) {\n    basicProps.rows = 3;\n  } else {\n    basicProps.rows = 2;\n  }\n  return basicProps;\n}\nconst Skeleton = props => {\n  const {\n    prefixCls: customizePrefixCls,\n    loading,\n    className,\n    style,\n    children,\n    avatar = false,\n    title = true,\n    paragraph = true,\n    active,\n    round\n  } = props;\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('skeleton', customizePrefixCls);\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  if (loading || !('loading' in props)) {\n    const hasAvatar = !!avatar;\n    const hasTitle = !!title;\n    const hasParagraph = !!paragraph;\n    // Avatar\n    let avatarNode;\n    if (hasAvatar) {\n      const avatarProps = Object.assign(Object.assign({\n        prefixCls: `${prefixCls}-avatar`\n      }, getAvatarBasicProps(hasTitle, hasParagraph)), getComponentProps(avatar));\n      // We direct use SkeletonElement as avatar in skeleton internal.\n      avatarNode = /*#__PURE__*/React.createElement(\"div\", {\n        className: `${prefixCls}-header`\n      }, /*#__PURE__*/React.createElement(Element, Object.assign({}, avatarProps)));\n    }\n    let contentNode;\n    if (hasTitle || hasParagraph) {\n      // Title\n      let $title;\n      if (hasTitle) {\n        const titleProps = Object.assign(Object.assign({\n          prefixCls: `${prefixCls}-title`\n        }, getTitleBasicProps(hasAvatar, hasParagraph)), getComponentProps(title));\n        $title = /*#__PURE__*/React.createElement(Title, Object.assign({}, titleProps));\n      }\n      // Paragraph\n      let paragraphNode;\n      if (hasParagraph) {\n        const paragraphProps = Object.assign(Object.assign({\n          prefixCls: `${prefixCls}-paragraph`\n        }, getParagraphBasicProps(hasAvatar, hasTitle)), getComponentProps(paragraph));\n        paragraphNode = /*#__PURE__*/React.createElement(Paragraph, Object.assign({}, paragraphProps));\n      }\n      contentNode = /*#__PURE__*/React.createElement(\"div\", {\n        className: `${prefixCls}-content`\n      }, $title, paragraphNode);\n    }\n    const cls = classNames(prefixCls, {\n      [`${prefixCls}-with-avatar`]: hasAvatar,\n      [`${prefixCls}-active`]: active,\n      [`${prefixCls}-rtl`]: direction === 'rtl',\n      [`${prefixCls}-round`]: round\n    }, className, hashId);\n    return wrapSSR( /*#__PURE__*/React.createElement(\"div\", {\n      className: cls,\n      style: style\n    }, avatarNode, contentNode));\n  }\n  return typeof children !== 'undefined' ? children : null;\n};\nSkeleton.Button = SkeletonButton;\nSkeleton.Avatar = SkeletonAvatar;\nSkeleton.Input = SkeletonInput;\nSkeleton.Image = SkeletonImage;\nSkeleton.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